package com.springbootnetty.handler;


import com.springbootnetty.dto.InBody;
import com.springbootnetty.entity.TbGps;
import com.springbootnetty.jt808.BaseHead;
import com.springbootnetty.mapper.TbGpsMapper;
import com.springbootnetty.utils.Jt808Util;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 位置上报 02 00
 *  512
 * */
@Component
@BenType(0x0200)
public class GpsHandler extends BaseHandler {

    @Resource
    TbGpsMapper tbGpsMapper;


    @Override
    public byte[] handle(InBody inBody, BaseHead baseHead) {
        System.out.println("gps。。。。。。。。。。。。。。。。。");
        TbGps tbGps = new TbGps(inBody,baseHead);
        tbGpsMapper.insert(tbGps);
        return tbGps.resp(inBody.getNewByte());
    }
}
